﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

/**
 * UI管理相关
 **/
public class UImanager : MonoBehaviour
{
    //单例模式
    public static UImanager instance { get; private set; }

    public Image healthBar;//角色的血条

    public Text bulletCountText;//子弹数量内容显示

    // Start is called before the first frame update
    void Awake()
    {
        instance = this;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void UpdateHealthBar(int curAmount, int maxAmount) {
        healthBar.fillAmount = (float)curAmount / maxAmount;
    }
    /*
     * 更新子弹数量文本显示
     */
    public void UpdateBulletCount(int curAmount, int maxAmount) {
        
        bulletCountText.text = curAmount.ToString() + " / " + maxAmount;

        Debug.Log(bulletCountText.text);
    }
}
